<style>
  .action-option ul li a:hover{
    color: #22223e;
  }
  .lock{
    -webkit-filter: grayscale(100%);
    -moz-filter: grayscale(100%);
    -ms-filter: grayscale(100%);
    -o-filter: grayscale(100%);
  }
  .table-responsive{
    overflow: unset;
  }
</style>

<!-- Page Title Start -->
<div class="row">
  <div class="colxl-12 col-lg-12 col-md-12 col-sm-12 col-12">
    <div class="page-title-wrapper">
      <div class="page-title-box">
        <h4 class="page-title bold"><?=$showFlag ? '用户管理':'寻找搭档' ?></h4>
      </div>
      <div class="ad-breadcrumb">
        <ul>
          <li>
            <div class="ad-user-btn">
              <form method="get" action="">
                <input type="hidden" value="1" name="pagenow">
                <input class="form-control" type="text" placeholder="在此输入后回车搜索用户" id="text-input" name="searchvalue">
                <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 56.966 56.966">
                  <path d="M55.146,51.887L41.588,37.786c3.486-4.144,5.396-9.358,5.396-14.786c0-12.682-10.318-23-23-23s-23,10.318-23,23
                                              s10.318,23,23,23c4.761,0,9.298-1.436,13.177-4.162l13.661,14.208c0.571,0.593,1.339,0.92,2.162,0.92
                                              c0.779,0,1.518-0.297,2.079-0.837C56.255,54.982,56.293,53.08,55.146,51.887z M23.984,6c9.374,0,17,7.626,17,17s-7.626,17-17,17
                                              s-17-7.626-17-17S14.61,6,23.984,6z"></path>
                </svg>
              </form>
            </div>
          </li>
          <? if($showFlag){ ?>
          <li>
            <div class="add-group">
              <a href="../admin/adduser.php" class="ad-btn">添加用户</a>
            </div>
          </li>
          <? } ?>
        </ul>
      </div>
    </div>
  </div>
</div>
<!-- Table Start -->
<div class="row">
  <!-- Styled Table Card-->
  <?=actionUserShowTips($_SESSION['actionUserShowTips'],$_SESSION['actionUsertipsType']); ?>
  <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
    <div class="card table-card">
      <div class="card-header pb-0">
        <h4>用户列表</h4>
      </div>
      <div class="card-body">
        <div class="chart-holder">
          <div class="table-responsive">
            <table class="table table-styled mb-0">
              <thead>
              <tr>
                <th>学号</th>
                <th>用户姓名</th>
                <th>简介</th>
                <th>性别</th>
                <th>用户身份</th>
                <th>最后登录时间</th>
                <th>操作</th>
              </tr>
              </thead>
              <tbody>
              <? foreach ($userList as $key=>$val){ ?>
              <tr>
                <td><?=$val[0]?></td>
                <td>
                                            <span class="img-thumb ">
                                                <? if(!empty($val[1])){ ?>
                                              <img class="<?=$val[5]==5 ? 'lock':'' ?>" src="../../uploads/userpic/<?=$val[1]?>" alt=" ">
                                              <? } ?>
                                              <span class="ml-2 "><?=$val[2]?></span>
                                            </span>
                </td>
                <td class="text-nowrap"><?=empty($val[3]) ? '这个人很懒没有写简介': textsub($val[3],30)  ?></td>
                <td><?=usexTurn($val[4]) ?></td>
                <td><label class="mb-0 badge badge-<?=idenBadge($val[5])?>"><?=uidenTurn($val[5])?></label></td>
                <td><?=timeDiff($val[6])?></td>
                <td class="relative">
                  <? if($showFlag){ ?>
                  <a class="action-btn " href="javascript:void(0); ">
                    <svg class="default-size " viewbox="0 0 341.333 341.333 ">
                      <g>
                        <g>
                          <g>
                            <path d="M170.667,85.333c23.573,0,42.667-19.093,42.667-42.667C213.333,19.093,194.24,0,170.667,0S128,19.093,128,42.667 C128,66.24,147.093,85.333,170.667,85.333z "></path>
                            <path d="M170.667,128C147.093,128,128,147.093,128,170.667s19.093,42.667,42.667,42.667s42.667-19.093,42.667-42.667 S194.24,128,170.667,128z "></path>
                            <path d="M170.667,256C147.093,256,128,275.093,128,298.667c0,23.573,19.093,42.667,42.667,42.667s42.667-19.093,42.667-42.667 C213.333,275.093,194.24,256,170.667,256z "></path>
                          </g>
                        </g>
                      </g>
                    </svg>
                  </a>
                  <div class="action-option">
                    <ul>
                      <li>
                        <a href="../admin/edituser.php?init=1&keyid=<?=$val[0]?>"><i class="fas fa-user-edit mr-2 "></i>修改</a>
                      </li>
                      <?if($val[5]!=0){ ?>
                      <li>
                        <? if($val[5]==5){ ?>
                        <a href="../public/userList.php?action=unlock&unlockid=<?=$val[0] ?>&unlockname=<?=$val[2] ?>&pagenow=<?=$rempagenow?>&searchvalue=<?=$remsearchvalue?>" ><i class="fas fa-user-lock mr-2 "></i>解封</a>
                        <?}elseif($val[5]!=5){ ?>
                        <a onclick="confirmLock( '<?=$val[2] ?>' , '<?=$val[0] ?>','<?=$rempagenow ?>' , '<?=$remsearchvalue ?>'  )" href="#" ><i class="fas fa-user-lock mr-2 "></i>封禁</a>
                        <?} ?>
                      </li>
                      <? } ?>
                      <li>
                        <a onclick="confirmDelete( '<?=$val[2] ?>' , '<?=$val[0] ?>' , '<?=$rempagenow ?>' , '<?=$remsearchvalue ?>' , '<?=$ListTotal ?>' , '<?=$pageTotal?>' )" href="#"><i class="fas fa-user-times mr-2 "></i>删除</a>
                      </li>
                    </ul>
                  </div>
                  <? }else{ ?>
                  <a class="action-btn font-weight-bold" href="./sendmess.php?gettoid=<?=$val[0]?>"><i class="fas fa-file-signature"></i>&nbsp;&nbsp;发消息</a>
                  <? }?>
                </td>
              </tr>
              <? }?>
              </tbody>
            </table>
          </div>
        </div>
        <div class="row mt-3">
          <div class="col-6 text-left mt-auto mb-auto">
            <? if($ListTotal>0){?>
            <h5>总 <span class="font-weight-bold text-primary"><?=$ListTotal ?></span> 条记录</h5>
            <? }else{ ?>
            <h5><strong>搜索无结果</strong></h5>
            <? } ?>
          </div>
          <!--分页开始-->

          <div class="col-6 text-right">
            <? if($pageTotal>1){ ?>
            <nav class="d-inline-block">
              <ul class="pagination">
                <!--首页-->
                <li class="page-item <?=$pageNow==1 ? disabled : ''  ?> ">
                  <a class="page-link" href="?pagenow=1&searchvalue=<?=$remsearchvalue?>"><i class="fas fa-angle-double-left"></i></a>
                </li>
                <!--上一页-->
                <li class="page-item <?=$pageNow==1 ? disabled : ''  ?> ">
                  <a class="page-link" href="?pagenow=<?=$rempagenow-1?>&searchvalue=<?=$remsearchvalue?>" tabindex="-1"><i class="fas fa-chevron-left"></i></a>
                </li>
                <!--页码-->
                <? for($i=1;$i<=$pageTotal;$i++){ ?>
                <? if($i==$rempagenow){ ?>
                <li class="page-item active">
                  <a class="page-link active" href="?pagenow=<?=$i?>&searchvalue=<?=$remsearchvalue?>"><?=$i?></a>
                </li>
                <?}else{ ?>
                <li class="page-item">
                  <a class="page-link active" href="?pagenow=<?=$i?>&searchvalue=<?=$remsearchvalue?>"><?=$i?></a>
                </li>
                <? }?>
                <? } ?>
                <!--下一页-->
                <li class="page-item <?=$pageNow==$pageTotal ? disabled : ''  ?> ">
                  <a class="page-link " href="?pagenow=<?=$rempagenow+1?>&searchvalue=<?=$remsearchvalue?>"><i class="fas fa-chevron-right "></i></a>
                </li>
                <!--页尾-->
                <li class="page-item <?=$pageNow==$pageTotal ? disabled : ''  ?> ">
                  <a class="page-link " href="?pagenow=<?=$pageTotal?>&searchvalue=<?=$remsearchvalue?>"><i class="fas fa-angle-double-right "></i></a>
                </li>
              </ul>
            </nav>
            <? } ?>
          </div>
          <!--分页结束-->
        </div>
        </form>
      </div>
    </div>
  </div>
</div>